package cn.wolfcode.luowowo.member.service;

import cn.wolfcode.luowowo.common.exception.LogicException;
import cn.wolfcode.luowowo.member.domain.UserInfo;

import java.util.List;

public interface IUserService {
    boolean checkPhone(String phone);

    void sendVerifyCode(String phone)throws LogicException;

    void userRegist(String phone, String nickname, String password, String rpassword, String code)throws LogicException;

    String userLogin(String username, String password) throws LogicException;

    List<UserInfo> list();

    /**
     * 查询单条数据
     * @param id
     * @return
     */
    UserInfo get(Long id);

    /**
     * 个人用户编辑
     * @param userInfo
     * @return
     */
    void update(UserInfo userInfo);

    /**
     * 修改头像
     * @param headImgUrl
     * @param id
     */
    void updateHeadImg(String headImgUrl, Long id);

    /**
     * 修改密码
     * @param rpassword
     * @param uid
     */
    void updatePassword(String rpassword, Long uid);

    /**
     * 修改手机号
     * @param newMobile
     * @param phone
     * @return ture:验证码一致 , false:验证码错误
     */
    boolean changePhone(String newMobile, String phone,String newVerifyCode);
}
